from selenium import webdriver
from selenium.webdriver.chrome.options import Options


def share_brower():
    chrome_options = Options()
    chrome_options.add_argument("--headless")
    chrome_options.add_argument("--disable-gpu")

    # path是你自己的Chrome游览器路径
    path = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
    chrome_options.binary_location = path

    brower = webdriver.Chrome(options=chrome_options)
    return brower


if __name__ == "__main__":
    brower = share_brower()
    brower.get("https://www.baidu.com")
    print(brower.page_source)
